<?php
session_start();
if ($_SESSION['auth'] != true && $_SESSION['rule'] != "ADMIN") {
	die('Not log in');
}
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Admin</title>
<link href="itelement.css" rel="stylesheet" type="text/css" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
	  <div class="viewer-head">
		<div class="viewer-head-left">Search Reader</div>
		<!--<div class="viewer-head-right"><input type="button" value="reset"></div>-->
	  </div>
	  <table bgcolor="#f1f8ff">
	  <tr bgcolor="#d0e3f1" class="table-header">
		<td width="20%">Username</td>
		<td width="30%">Firstname</td>
		<td width="30%">Lastname</td>
		<td width="20%">Company</td>
		<td width="1">&nbsp;</td>
	  </tr>
	  <?php
	  include("includes/adminController.php");
	  
	  $readers = searchReader($_GET['username'],$_GET['fname'],$_GET['lname'],$_GET['company']);
	  
	  foreach($readers as $r)
	  {
	  echo "<tr><td><a href=\"admin_edit_reader.php?username=".$r['username']."\">".$r['username']."</a></td>";
	  echo "<td>".$r['fname']."</td>";
	  echo "<td>".$r['lname']."</td>";
	  echo "<td>".$r['company']."</td></tr>";
	  }
	  ?>
	  </table>
	  <div id="status"></div>
</body>
</html>